﻿using System.Collections.Generic;
using System.IO;

namespace Effector.Data
{
    /// <summary>
    /// Information on the logical drives of the system.
    /// </summary>
    public class LogicalDriveElement
    {
        private DriveInfo _drive;

        /// <summary>
        /// Initializes a new instance of the <see cref="LogicalDriveElement"/> class.
        /// </summary>
        public LogicalDriveElement()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="LogicalDriveElement"/> class.
        /// </summary>
        /// <param name="di">Drive information through the DriveInfo class.</param>
        public LogicalDriveElement(DriveInfo di)
        {
            _drive = di;
        }

        /// <summary>
        /// Gets the name of the logical drive.
        /// </summary>
        /// <value>The name.</value>
        /// <example>
        /// Names of local drives might be:
        /// 
        /// c:\
        /// d:\
        /// e:\
        /// 
        /// including CD-Roms or removable media.
        /// </example>
        public string Name
        {
            get { return _drive.Name; }
        }

        private List<DirectoryElement> _directories = new List<DirectoryElement>();

        /// <summary>
        /// Gets the first level of directories of this drive.
        /// </summary>
        /// <value>A lst of directories.</value>
        public List<DirectoryElement> Directories
        {
            get { return _directories; }
        }
    }
}
